Fixing some of the "@return true" or "@return false", need to be "@return bool" and...
authorSam Reed <reedy@users.mediawiki.org>
Thu, 9 Feb 2012 18:01:54 +0000 (18:01 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Thu, 9 Feb 2012 18:01:54 +0000 (18:01 +0000)
Other documentation improvements

26 files changed:
includes/Action.php
includes/Article.php
includes/Autopromote.php
includes/BacklinkCache.php
includes/Block.php
includes/EditPage.php
includes/GlobalFunctions.php
includes/HistoryBlob.php
includes/actions/HistoryAction.php
includes/api/ApiPageSet.php
includes/api/ApiQuery.php
includes/api/ApiQueryBase.php
includes/cache/MessageCache.php
includes/db/Database.php
includes/db/DatabaseIbm_db2.php
includes/db/DatabaseMysql.php
includes/db/DatabaseSqlite.php
includes/db/LoadBalancer.php
includes/filerepo/FileRepo.php
includes/filerepo/RepoGroup.php
includes/filerepo/backend/FileBackend.php
includes/filerepo/backend/FileOp.php
includes/filerepo/backend/SwiftFileBackend.php
includes/filerepo/backend/lockmanager/DBLockManager.php
includes/filerepo/file/File.php
includes/filerepo/file/LocalFile.php

index 37c4848..328ce97 100644 (file)
@@ -78,7 +78,7 @@ abstract class Action {
         * @param $action String
         * @param $page Page
         * @param $context IContextSource
-        * @return Action|false|null false if the action is disabled, null
+        * @return Action|bool|null false if the action is disabled, null
         *     if it is not recognised
         */
        public final static function factory( $action, Page $page, IContextSource $context = null ) {
index 1fbcdb4..b21f71f 100644 (file)
@@ -188,7 +188,7 @@ class Article extends Page {
         * This function has side effects! Do not use this function if you
         * only want the real revision text if any.
         *
-        * @return Return the text of this revision
+        * @return string Return the text of this revision
         */
        public function getContent() {
                global $wgUser;
@@ -1582,7 +1582,7 @@ class Article extends Page {
 
        /**
         * Get parser options suitable for rendering the primary article wikitext
-        * @return ParserOptions|false
+        * @return ParserOptions|bool
         */
        public function getParserOptions() {
                global $wgUser;
index a233603..38adf14 100644 (file)
@@ -32,7 +32,7 @@ class Autopromote {
         *
         * Does not return groups the user already belongs to or has once belonged.
         *
-        * @param $user The user to get the groups for
+        * @param $user User The user to get the groups for
         * @param $event String key in $wgAutopromoteOnce (each one has groups/criteria)
         *
         * @return array Groups the user should be promoted to.
index d17104f..152c5f0 100644 (file)
@@ -103,7 +103,7 @@ class BacklinkCache {
        /**
         * Get the slave connection to the database
         * When non existing, will initialize the connection.
-        * @return Database object
+        * @return DatabaseBase object
         */
        protected function getDB() {
                if ( !isset( $this->db ) ) {
index ded9cf9..c258dd2 100644 (file)
@@ -893,7 +893,7 @@ class Block {
         * Encode expiry for DB
         *
         * @param $expiry String: timestamp for expiry, or
-        * @param $db Database object
+        * @param $db DatabaseBase object
         * @return String
         * @deprecated since 1.18; use $dbw->encodeExpiry() instead
         */
index 29aaee8..dc671a6 100644 (file)
@@ -1551,7 +1551,7 @@ class EditPage {
         *
         * @param $text string
         *
-        * @return string|false matching string or false
+        * @return string|bool matching string or false
         */
        public static function matchSpamRegex( $text ) {
                global $wgSpamRegex;
@@ -1565,7 +1565,7 @@ class EditPage {
         *
         * @parma $text string
         *
-        * @return string|false  matching string or false
+        * @return string|bool  matching string or false
         */
        public static function matchSummarySpamRegex( $text ) {
                global $wgSummarySpamRegex;
index ab93508..b6e74b7 100644 (file)
@@ -980,8 +980,8 @@ function wfLogDBError( $text ) {
  * Throws a warning that $function is deprecated
  *
  * @param $function String
- * @param $version String|false: Added in 1.19.
- * @param $component String|false: Added in 1.19.
+ * @param $version String|bool: Added in 1.19.
+ * @param $component String|bool: Added in 1.19.
  * 
  * @return null
  */
@@ -3445,7 +3445,7 @@ function &wfGetLBFactory() {
  * Shortcut for RepoGroup::singleton()->findFile()
  *
  * @param $title String or Title object
- * @param $options Associative array of options:
+ * @param $options array Associative array of options:
  *     time:           requested time for an archived image, or false for the
  *                     current version. An image object will be returned which was
  *                     created at the specified time.
@@ -3806,7 +3806,7 @@ function wfRunHooks( $event, $args = array() ) {
  * because php might make it negative.
  *
  * @throws MWException if $data not long enough, or if unpack fails
- * @return Associative array of the extracted data
+ * @return array Associative array of the extracted data
  */
 function wfUnpack( $format, $data, $length=false ) {
        if ( $length !== false ) {
index f707b3f..dcb25cd 100644 (file)
@@ -179,8 +179,8 @@ class HistoryBlobStub {
        var $mOldId, $mHash, $mRef;
 
        /**
-        * @param $hash Strng: the content hash of the text
-        * @param $oldid Integer: the old_id for the CGZ object
+        * @param $hash string the content hash of the text
+        * @param $oldid Integer the old_id for the CGZ object
         */
        function __construct( $hash = '', $oldid = 0 ) {
                $this->mHash = $hash;
@@ -298,7 +298,7 @@ class HistoryBlobCurStub {
        }
 
        /**
-        * @return string|false
+        * @return string|bool
         */
        function getText() {
                $dbr = wfGetDB( DB_SLAVE );
index 23a3f3d..254a5db 100644 (file)
@@ -69,7 +69,6 @@ class HistoryAction extends FormlessAction {
 
        /**
         * Print the history page for an article.
-        * @return nothing
         */
        function onView() {
                global $wgScript, $wgUseFileCache, $wgSquidMaxage;
@@ -108,7 +107,8 @@ class HistoryAction extends FormlessAction {
                $feedType = $request->getVal( 'feed' );
                if ( $feedType ) {
                        wfProfileOut( __METHOD__ );
-                       return $this->feed( $feedType );
+                       $this->feed( $feedType );
+                       return;
                }
 
                // Fail nicely if article doesn't exist.
index 7b84c47..cc86c76 100644 (file)
@@ -342,7 +342,7 @@ class ApiPageSet extends ApiQueryBase {
 
        /**
         * Populate this PageSet from a rowset returned from the database
-        * @param $db Database object
+        * @param $db DatabaseBase object
         * @param $queryResult ResultWrapper Query result object
         */
        public function populateFromQueryResult( $db, $queryResult ) {
index 5a98ecf..c172d24 100644 (file)
@@ -135,7 +135,7 @@ class ApiQuery extends ApiBase {
 
        /**
         * Gets a default slave database connection object
-        * @return Database
+        * @return DatabaseBase
         */
        public function getDB() {
                if ( !isset( $this->mSlaveDB ) ) {
index 4fe82de..2666045 100644 (file)
@@ -392,7 +392,7 @@ abstract class ApiQueryBase extends ApiBase {
         * @param $name string Name to assign to the database connection
         * @param $db int One of the DB_* constants
         * @param $groups array Query groups
-        * @return Database
+        * @return DatabaseBase
         */
        public function selectNamedDB( $name, $db, $groups ) {
                $this->mDb = $this->getQuery()->getNamedDB( $name, $db, $groups );
index 78342f5..f916503 100644 (file)
@@ -696,7 +696,7 @@ class MessageCache {
         * @param $title String: Message cache key with initial uppercase letter.
         * @param $code String: code denoting the language to try.
         *
-        * @return string|false
+        * @return string|bool
         */
        function getMsgFromNamespace( $title, $code ) {
                global $wgAdaptiveMessageCache;
index 2c9a128..ab9e2f4 100644 (file)
@@ -2599,7 +2599,7 @@ abstract class DatabaseBase implements DatabaseType {
         *
         * @param $sql String SQL query we will append the limit too
         * @param $limit Integer the SQL limit
-        * @param $offset Integer|false the SQL offset (default false)
+        * @param $offset Integer|bool the SQL offset (default false)
         *
         * @return string
         */
@@ -3009,7 +3009,7 @@ abstract class DatabaseBase implements DatabaseType {
         * installations. Most callers should use LoadBalancer::safeGetLag()
         * instead.
         *
-        * @return Database replication lag in seconds
+        * @return int Database replication lag in seconds
         */
        function getLag() {
                return intval( $this->mFakeSlaveLag );
@@ -3134,7 +3134,7 @@ abstract class DatabaseBase implements DatabaseType {
         * ones in $GLOBALS. If an array is set here, $GLOBALS will not be used at
         * all. If it's set to false, $GLOBALS will be used.
         *
-        * @param $vars False, or array mapping variable name to value.
+        * @param $vars bool|array mapping variable name to value.
         */
        function setSchemaVars( $vars ) {
                $this->mSchemaVars = $vars;
index 7aefd59..03dbac9 100644 (file)
@@ -472,7 +472,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
         * @param $user String
         * @param $password String
         * @param $dbName String: database name
-        * @return a fresh connection
+        * @return DatabaseBase a fresh connection
         */
        public function open( $server, $user, $password, $dbName ) {
                wfProfileIn( __METHOD__ );
@@ -1279,11 +1279,11 @@ class DatabaseIbm_db2 extends DatabaseBase {
         * @param $conds   Array or string, condition(s) for WHERE
         * @param $fname   String: calling function name (use __METHOD__)
         *                 for logs/profiling
-        * @param $options Associative array of options
+        * @param $options array Associative array of options
         *                 (e.g. array( 'GROUP BY' => 'page_title' )),
         *                 see Database::makeSelectOptions code for list of
         *                 supported stuff
-        * @param $join_conds Associative array of table join conditions (optional)
+        * @param $join_conds array Associative array of table join conditions (optional)
         *                    (e.g. array( 'page' => array('LEFT JOIN',
         *                    'page_latest=rev_id') )
         * @return Mixed: database result resource for fetch functions or false
@@ -1333,7 +1333,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
         *
         * @private
         *
-        * @param $options Associative array of options to be turned into
+        * @param $options array Associative array of options to be turned into
         *              an SQL query, valid keys are listed in the function.
         * @return Array
         */
index a23d9cd..6b5b6bc 100644 (file)
@@ -585,7 +585,7 @@ class DatabaseMysql extends DatabaseBase {
        /**
         * Get the position of the master from SHOW SLAVE STATUS
         *
-        * @return MySQLMasterPos|false
+        * @return MySQLMasterPos|bool
         */
        function getSlavePos() {
                if ( !is_null( $this->mFakeSlaveLag ) ) {
@@ -606,7 +606,7 @@ class DatabaseMysql extends DatabaseBase {
        /**
         * Get the position of the master from SHOW MASTER STATUS
         *
-        * @return MySQLMasterPos|false
+        * @return MySQLMasterPos|bool
         */
        function getMasterPos() {
                if ( $this->mFakeMaster ) {
index d266125..23c7a6b 100644 (file)
@@ -617,7 +617,7 @@ class DatabaseSqlite extends DatabaseBase {
         * Get information about a given field
         * Returns false if the field does not exist.
         *
-        * @return SQLiteField|false
+        * @return SQLiteField|bool
         */
        function fieldInfo( $table, $field ) {
                $tableName = $this->tableName( $table );
index e96c672..5357eb4 100644 (file)
@@ -385,7 +385,7 @@ class LoadBalancer {
         * Returns false if there is no connection open
         *
         * @param $i int
-        * @return DatabaseBase|false
+        * @return DatabaseBase|bool
         */
        function getAnyOpenConnection( $i ) {
                foreach ( $this->mConns as $conns ) {
index 1ccbd46..1242853 100644 (file)
@@ -295,7 +295,7 @@ class FileRepo {
         *     private:        If true, return restricted (deleted) files if the current
         *                     user is allowed to view them. Otherwise, such files will not
         *                     be found.
-        * @return File|false
+        * @return File|bool
         */
        public function findFile( $title, $options = array() ) {
                $title = File::normalizeTitle( $title );
@@ -377,8 +377,8 @@ class FileRepo {
         * version control should return false if the time is specified.
         *
         * @param $sha1 String base 36 SHA-1 hash
-        * @param $options Option array, same as findFile().
-        * @return File|false
+        * @param $options array Option array, same as findFile().
+        * @return File|bool
         */
        public function findFileFromKey( $sha1, $options = array() ) {
                $time = isset( $options['time'] ) ? $options['time'] : false;
@@ -419,7 +419,7 @@ class FileRepo {
        /**
         * Get the public root URL of the repository
         *
-        * @return string|false
+        * @return string|bool
         */
        public function getRootUrl() {
                return $this->url;
@@ -531,7 +531,7 @@ class FileRepo {
         *
         * @param $query mixed Query string to append
         * @param $entry string Entry point; defaults to index
-        * @return string|false
+        * @return string|bool
         */
        public function makeUrl( $query = '', $entry = 'index' ) {
                if ( isset( $this->scriptDirUrl ) ) {
@@ -611,7 +611,7 @@ class FileRepo {
        /**
         * Get the URL of the stylesheet to apply to description pages
         *
-        * @return string|false
+        * @return string|bool
         */
        public function getDescriptionStylesheetUrl() {
                if ( isset( $this->scriptDirUrl ) ) {
@@ -1188,7 +1188,7 @@ class FileRepo {
         * Get the timestamp of a file with a given virtual URL/storage path
         *
         * @param $virtualUrl string
-        * @return string|false
+        * @return string|bool
         */
        public function getFileTimestamp( $virtualUrl ) {
                $path = $this->resolveToStoragePath( $virtualUrl );
@@ -1199,7 +1199,7 @@ class FileRepo {
         * Get the sha1 of a file with a given virtual URL/storage path
         *
         * @param $virtualUrl string
-        * @return string|false
+        * @return string|bool
         */
        public function getFileSha1( $virtualUrl ) {
                $path = $this->resolveToStoragePath( $virtualUrl );
index 334ef2b..99c1115 100644 (file)
@@ -65,7 +65,7 @@ class RepoGroup {
        /**
         * Construct a group of file repositories.
         *
-        * @param $localInfo Associative array for local repo's info
+        * @param $localInfo array Associative array for local repo's info
         * @param $foreignInfo Array of repository info arrays.
         *     Each info array is an associative array with the 'class' member
         *     giving the class name. The entire array is passed to the repository
index 13abcbc..7cbfb91 100644 (file)
@@ -406,7 +406,7 @@ abstract class FileBackend {
         *     latest : use the latest available data
         * 
         * @param $params Array
-        * @return string|false TS_MW timestamp or false on failure
+        * @return string|bool TS_MW timestamp or false on failure
         */
        abstract public function getFileTimestamp( array $params );
 
@@ -419,7 +419,7 @@ abstract class FileBackend {
         *     latest : use the latest available data
         * 
         * @param $params Array
-        * @return string|false Returns false on failure
+        * @return string|bool Returns false on failure
         */
        abstract public function getFileContents( array $params );
 
@@ -431,7 +431,7 @@ abstract class FileBackend {
         *     latest : use the latest available data
         * 
         * @param $params Array
-        * @return integer|false Returns false on failure
+        * @return integer|bool Returns false on failure
         */
        abstract public function getFileSize( array $params );
 
@@ -448,7 +448,7 @@ abstract class FileBackend {
         *     latest : use the latest available data
         * 
         * @param $params Array
-        * @return Array|false|null Returns null on failure
+        * @return Array|bool|null Returns null on failure
         */
        abstract public function getFileStat( array $params );
 
@@ -460,7 +460,7 @@ abstract class FileBackend {
         *     latest : use the latest available data
         * 
         * @param $params Array
-        * @return string|false Hash string or false on failure
+        * @return string|bool Hash string or false on failure
         */
        abstract public function getFileSha1Base36( array $params );
 
index e51f5b1..300d513 100644 (file)
@@ -297,7 +297,7 @@ abstract class FileOp {
         * precheckDestExistence() helper function to get the source file SHA-1.
         * Subclasses should overwride this iff the source is not in storage.
         *
-        * @return string|false Returns false on failure
+        * @return string|bool Returns false on failure
         */
        protected function getSourceSha1Base36() {
                return null; // N/A
@@ -324,7 +324,7 @@ abstract class FileOp {
         * 
         * @param $source string Storage path
         * @param $predicates Array
-        * @return string|false 
+        * @return string|bool
         */
        final protected function fileSha1( $source, array $predicates ) {
                if ( isset( $predicates['sha1'][$source] ) ) {
index 2ad2d91..b0a94c5 100644 (file)
@@ -693,7 +693,7 @@ class SwiftFileBackend extends FileBackendStore {
        /**
         * Get a connection to the Swift proxy
         *
-        * @return CF_Connection|false
+        * @return CF_Connection|bool
         * @throws InvalidResponseException
         */
        protected function getConnection() {
index 045056e..8682eb6 100644 (file)
@@ -245,7 +245,7 @@ class DBLockManager extends LockManager {
         * Get (or reuse) a connection to a lock DB
         *
         * @param $lockDb string
-        * @return Database
+        * @return DatabaseBase
         * @throws DBError
         */
        protected function getConnection( $lockDb ) {
index 0be67e0..5d5647e 100644 (file)
@@ -252,7 +252,7 @@ abstract class File {
        /**
         * Return the associated title object
         *
-        * @return Title|false
+        * @return Title|bool
         */
        public function getTitle() {
                return $this->title;
@@ -329,7 +329,7 @@ abstract class File {
        * Most callers don't check the return value, but ForeignAPIFile::getPath
        * returns false.
         *
-        * @return string|false
+        * @return string|bool
        */
        public function getPath() {
                if ( !isset( $this->path ) ) {
@@ -344,7 +344,7 @@ abstract class File {
         * Returns false on failure. Callers must not alter the file.
         * Temporary files are cleared automatically.
         *
-        * @return string|false
+        * @return string|bool
         */
        public function getLocalRefPath() {
                $this->assertRepoDefined();
@@ -774,7 +774,7 @@ abstract class File {
         * @param $params Array: an associative array of handler-specific parameters.
         *                Typical keys are width, height and page.
         * @param $flags Integer: a bitfield, may contain self::RENDER_NOW to force rendering
-        * @return MediaTransformOutput|false
+        * @return MediaTransformOutput|bool
         */
        function transform( $params, $flags = 0 ) {
                global $wgUseSquid, $wgIgnoreImageErrors, $wgThumbnailEpoch;
@@ -1329,7 +1329,7 @@ abstract class File {
        /**
         * Returns the repository
         *
-        * @return FileRepo|false
+        * @return FileRepo|bool
         */
        function getRepo() {
                return $this->repo;
@@ -1418,7 +1418,7 @@ abstract class File {
         * @param $versions array set of record ids of deleted items to restore,
         *                    or empty to restore all revisions.
         * @param $unsuppress bool remove restrictions on content upon restoration?
-        * @return int|false the number of file revisions restored if successful,
+        * @return int|bool the number of file revisions restored if successful,
         *         or false on failure
         * STUB
         * Overridden by LocalFile
@@ -1548,7 +1548,7 @@ abstract class File {
        /**
         * Get the 14-character timestamp of the file upload
         *
-        * @return string|false TS_MW timestamp or false on failure
+        * @return string|bool TS_MW timestamp or false on failure
         */
        function getTimestamp() {
                $this->assertRepoDefined();
index 4c4e161..bf05771 100644 (file)
@@ -620,7 +620,7 @@ class LocalFile extends File {
 
        /**
         * Get all thumbnail names previously generated for this file
-        * @param $archiveName string|false Name of an archive file
+        * @param $archiveName string|bool Name of an archive file
         * @return array first element is the base dir, then files in that base dir.
         */
        function getThumbnails( $archiveName = false ) {